<?php

namespace app\api\controller;

use app\services\CouponService;
use support\Request;

class CouponController
{
    public function list(Request $request)
    {
        try {
            $data = CouponService::square();

            return ok_rsp('成功', $data);
        } catch (\Exception $e) {
            return err_rsp($e->getMessage());
        }
    }

    public function register(Request $request)
    {
        try {

            $data = CouponService::register();

            return ok_rsp('成功', $data);
        } catch (\Exception $e) {
            return err_rsp($e->getMessage());
        }
    }
}